package com.kefu.chat.vo;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.chat.model.ChatPoster;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractSearchVo;
import lombok.Data;

@Data
public class ChatPosterSearchVo extends AbstractSearchVo {
    @Override
    public LambdaQueryWrapper<ChatPoster> lambdaQuery() {
        LambdaQueryWrapper<ChatPoster> wrapper = Wrappers.lambdaQuery(ChatPoster.class);
        wrapper.eq(ChatPoster::getTenantId, KefuContext.getTid());
        wrapper.orderByDesc(ChatPoster::getUpdateTime);
        return wrapper;
    }
}
